#pragma once

#include "test_framework/TFTest.h"
#include "test/BDIODeviceLibSupportBase.h"
#include "device/IODeviceContext.h"
#include "DetailRefreshParam.pb.h"
#include "PainterRefreshParam.pb.h"
#include "BDString.h"
#include "BDReceiver.h"

#define BUTTON_YELLOW_BIT      0
#define BUTTON_RED_BIT         1
#define BUTTON_GREEN_BIT       2

class BDTestBase : public TFTest, public BDIODeviceLibSupportBase
{

public:
	BDTestBase(BDString name)
		: TFTest(name)
	{
	}
	~BDTestBase(){}

	void SetUp()
	{
		InitialIODeviceManager(m_Context);
		RegisterDeviceListener();
		InitDevices();
	}

	void TearDown()
	{
		DeInitDevices();
		DestroyIODeviceManager();
	}

	static IODeviceContext* GetContext()
	{
		return m_Context;
	}

	void NoticeUpdateUI();

	void AllocPainterParamShape(int num);

	void AllocDetailParamItem(int num);

	PainterRefreshParam_Shape* GetPainterParamShape(int num);

	DetailRefreshParam_Item* GetDetailParamItem(int num);

	void Notify();

protected:

	DetailRefreshParam* m_pDetailParam;

	PainterRefreshParam* m_pPainterParam;

	bool m_bStartFlag;

	static IODeviceContext* m_Context;

};